package controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;
import javax.swing.Timer;

import model.*;

import view.*;

//controls any movement

public class logController  {
	private JPanel view;
	private gameModelI model;
	private userInputController inputController;
	Timer time = new Timer(30, new ActionListener() {

		@Override
		public void actionPerformed(ActionEvent arg0) {
			model.moveLogs(1);
			model.getFrog().move(1);
			if(model.getFrog().outOfBounds()) {
				inputController.frogHitEdge();
			}
			
			view.repaint();
		}} );
	
	public logController(gameModelI m, JPanel v, userInputController c) {
		this.model = m;
		this.view = v;
		this.inputController = c;
	}
	
	public void start() {
		time.start();
	}
	
	public void stop() {
		time.stop();
	}
	
}
	
	
